home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / vsrc.tar / voyager7_src / pager.c < prev    next >
C/C++ Source or Header  |  1991-02-27  |  1KB  |  54 lines

  1. /*
  2. // Abstract:
  3. //    PAGER---Display Pager
  4. //
  5. //    The Display Pager module counts lines of text that have been
  6. //    displayed and after a specified number of lines, will ask:
  7. //    "Press RETURN to contine: ".
  8. //
  9. // Author:
  10. //    Derek S. Nickel
  11. //
  12. // Creation date:
  13. //    27 October 1990
  14. //
  15. // History:
  16. // V01-001    Derek S. Nickel        27-OCT-1990
  17. //    Original.
  18. //
  19. */
  20.  
  21. #include <conio.h>
  22. #include <stdio.h>
  23.  
  24. #include "pager.h"
  25. #include "modes.h"
  26.  
  27. /***********************************************************************
  28.     pager
  29. ***********************************************************************/
  30.  
  31. void pager(int xlines)
  32. {
  33.     static int displayed_lines = 0;
  34.     static int max_lines = 23;
  35.  
  36.     if (xlines > 0) {
  37.         displayed_lines = 0;
  38.         max_lines = xlines;
  39.     } else if (xlines < 0) {
  40.         displayed_lines = 0;
  41.     } else {
  42.         if (displayed_lines == max_lines) {
  43.             displayed_lines = 0;
  44.             if (modes.pager) {
  45.                 printf("Press RETURN to contine: ");
  46.                 getch();
  47.                 printf("\r                         \r");
  48.  
  49.             }
  50.         }
  51.         displayed_lines++;
  52.     }
  53. }
  54.